package mocks

import "fmt"

type userService struct {
	dao UserDao
}

func (s *userService) getById(id int) *User {
	u, err := s.dao.getById(id)
	if err != nil {
		fmt.Println("getById fail err:", err)
		return nil
	}
	return u
}

func (s *userService) save(user *User) bool {
	err := s.dao.save(user)
	if err != nil {
		fmt.Println("save fail err:", err)
		return false
	}
	return true
}
